package com.briup.jdbc.manager;

import java.lang.reflect.Proxy;
import java.sql.SQLException;

import com.briup.jdbc.handler.JDBCHandler;

public class JDBCManager {

	public static SQLSession getSQLSession() throws SQLException, InterruptedException {
		return new SQLSession();
	}

	public static <T> T getMapper(Class<T> clas)
			throws IllegalArgumentException, InstantiationException, IllegalAccessException {
		return (T) Proxy.newProxyInstance(clas.getClassLoader(), new Class[] { clas }, new JDBCHandler(clas));
	}

}
